package com.lvchenglong;

import com.lvchenglong.aopdemo.UserService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * A template class for quick start project
 *
 * @author Lv Chenglong
 */
@EnableAspectJAutoProxy
public class App {
    public static void main(String[] args) {

        // Spring AOP 例子 https://www.jianshu.com/p/a21256903fdd
        AnnotationConfigApplicationContext app = new AnnotationConfigApplicationContext(AppConfig.class);
//        app.register(AppConfig.class);
//        app.register(UserService.class);
//        app.refresh();

        UserService service = app.getBean(UserService.class);
        service.small();
    }
}
